import {request} from 'umi';

/* 根据用户和密码获取凭证 */
export async function token(body) {
  return request('/auth/token', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
  });
}

/* 获取登陆用户信息 */
export async function user() {
  return request('/auth/user', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
  });
}
